
<div class="imgbox_<{$upload_input_name}>">
    <{if $input_type == 'file' && $image_list}>
        <div class="imgbox">
            <p><{$image_list}></p>
            <input type="hidden" name="<{$upload_input_name}>" value="<{$image_list}>">
            <p onclick="form_images_remove(this)">删除</p>
        </div>
    <{else}>
	    <{foreach from=$image_list item="img"}>
	    <div class="imgbox">
	        <img class="upimg" src="<{$img}>">
	        <{if $action_type == 'detail'}>
	        <{else}>
	        <input type="hidden" name="<{$upload_input_name}>[]" value="<{$img}>">
	        <p onclick="form_images_remove(this)">删除</p>
	        <{/if}>
	    </div>
	    <{/foreach}>
    <{/if}>
</div>

<{if ! $has_include_upload_js && action_type != 'detail' }>
<link rel="stylesheet" type="text/css" href="/resource/uploadify/uploadify.css">
<script type="text/javascript" src="/resource/uploadify/jquery.uploadify.min.js?20150203"></script>
<{/if}>

<{if $action_type != 'detail'}>

<script>
function form_images_remove(img)
{
    if (confirm('delete this'))
    {
        $(img).parent().remove();
    }
}

</script>


<div class="imgbox_action">
    <input type="file" name="file_upload_<{$upload_input_name}>" id="file_upload_<{$upload_input_name}>" />
</div>


<script>
　$(function(){
 　　   $('#file_upload_<{$upload_input_name}>').uploadify({

			'formData'     : {
					'timestamp' : '<{$upload.timestamp}>',
					'token'     : '<{$upload.token}>',
				},

       　　 'swf'      :'/resource/uploadify/uploadify.swf',
     　　　 'uploader' :'/test/upload/upload',

                onUploadError: function(file,errorCode,erorMsg,errorString){
                    alert(errorString);
                },

                onUploadProgress: function(file,bytesUploaded,bytesTotal,totalBytesUploaded,totalBytesTotal){
                    //$('#pregress').html('总共需要上传'+bytesTotal+'字节，'+'已上传'+totalBytesTotal+'字节')
                },

                onUploadStart: function(file){
                },

                onUploadSuccess: function(file,data,respone){
                    imgsrc = data;
                    <{if $input_type == 'file'}>
                    html = $('.imgbox_<{$upload_input_name}>').html();
                    imgbox = '<div class="imgbox">'
                             + '<p>' + imgsrc + '</p>'
                             + '<input type="hidden" name="<{$upload_input_name}>[]" value="' + imgsrc + '">'
                             + '<p onclick="form_images_remove(this)">删除</p>'
                             + '</div>';
                    <{else}>
                    html = $('.imgbox_<{$upload_input_name}>').html();
                    imgbox = '<div class="imgbox">'
                             + '<img class="upimg" src="' + imgsrc + '">'
                             + '<input type="hidden" name="<{$upload_input_name}>[]" value="' + imgsrc + '">'
                             + '<p onclick="form_images_remove(this)">删除</p>'
                             + '</div>';
                    <{/if}>

                    $('.imgbox_<{$upload_input_name}>').html(imgbox + html);
                }
                //每个文件上传成功后触发  
    　　　});
　　　});
</script>
<{/if}>
